package com.bigdata.collector.util;

/* 
 * read property from setting.properties 
 */
import java.io.InputStream;
import java.util.Properties;

public final class Env extends Properties {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static Env instance;

	public static Env getInstance() {
		if (instance != null) {
			return instance;
		} else {
			makeInstance();
			return instance;
		}
	}

	// synchronized method
	private static synchronized void makeInstance() {
		if (instance == null) {
			instance = new Env();
		}
	}

	private Env() {
		InputStream is = getClass().getResourceAsStream("/setting.properties");
		try {
			load(is);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}